<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.jpg">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.jpg">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"matian.connorma.cn","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="程序猿">
<meta property="og:type" content="website">
<meta property="og:title" content="马天">
<meta property="og:url" content="http://matian.connorma.cn/page/2/index.html">
<meta property="og:site_name" content="马天">
<meta property="og:description" content="程序猿">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="马天">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://matian.connorma.cn/page/2/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : true,
    isPost : false,
    lang   : 'zh-CN'
  };
</script>

  <title>马天</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">马天</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content index posts-expand">
            
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/db92b212.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/db92b212.html" class="post-title-link" itemprop="url">minio单机及集群部署</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-02-22 15:21:17" itemprop="dateCreated datePublished" datetime="2020-02-22T15:21:17+08:00">2020-02-22</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/minio/" itemprop="url" rel="index"><span itemprop="name">minio</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>minio提供对象存储，支持单节点部署及集群部署；集群部署模式下最少4节点，集群需要至少N&#x2F;2节点在线才可读，至少N&#x2F;2+1节点在线才可写——准确的说，至少需要4块“盘”，两个节点每个节点两块“盘”也是可行的</p>
<p>以下记录centos 7下的minio单机及集群部署，最初只记录了minio单节点部署，现在进行了完善，替换为minio新版本，通过配置文件的方式自动识别按单机模式或者集群模式启动</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/db92b212.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/9b1b03df.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/9b1b03df.html" class="post-title-link" itemprop="url">使用ntp或chrony部署时间同步服务</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-01-11 08:23:43" itemprop="dateCreated datePublished" datetime="2020-01-11T08:23:43+08:00">2020-01-11</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/linux/" itemprop="url" rel="index"><span itemprop="name">linux</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>软件系统尤其是分布式系统需要保持多个节点的主机时间一致。内网环境中可以从授时服务器同步时间，因为不是所有机器都有公网访问权限，因此在内网中搭建了NTP服务器，由NTP服务器向互联网授时服务器同步时间，其他内网服务器向内网NTP服务器同步时间。</p>
<p>通过配置ntp或chrony可以进行服务器时间同步，两者支持作为服务端提供授时服务，或作为客户端从授时服务器同步时间；两者可以单独使用，也可以搭配使用，但是同一主机不要同时启用以避免冲突。比如：</p>
<ul>
<li>NTP服务器A使用ntp服务从互联网授时服务器同步时间，其他内网服务器使用ntp服务从A同步时间</li>
<li>NTP服务器A使用chrony服务从互联网授时服务器同步时间，其他内网服务器使用ntp服务从A同步时间</li>
<li>NTP服务器A使用ntp服务从互联网授时服务器同步时间，其他内网服务器使用chrony服务从A同步时间</li>
<li>NTP服务器A使用chrony服务从互联网授时服务器同步时间，其他内网服务器使用chrony服务从A同步时间</li>
</ul>
<p>客户端也可以通过crontab+ntpdate的方式从授时服务器同步时间，但是这一方式会引起时间跳变，可能引起意想不到的bug；而ntp&#x2F;chrony同步时间是步进式的，将逐步调整时间以达到一致</p>
<p>相比于ntp服务，chrony精度更高、同步更快，在centos 7中默认安装了chrony并默认启用</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/9b1b03df.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/a5d8fb53.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/a5d8fb53.html" class="post-title-link" itemprop="url">Spring Boot 启动流程简记</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-11-01 17:57:21" itemprop="dateCreated datePublished" datetime="2019-11-01T17:57:21+08:00">2019-11-01</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Spring/" itemprop="url" rel="index"><span itemprop="name">Spring</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>代码来自于Spring Boot 2.0.4.RELEASE</p>
<p>SpringApplication类负责由main方法启动spring应用，文档中给出了启动的主要步骤：</p>
<ul>
<li>创建ApplicationContext</li>
<li>处理命令行参数</li>
<li>refresh ApplicationContext，加载bean</li>
<li>触发各类Runner</li>
</ul>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/a5d8fb53.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/31d2f121.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/31d2f121.html" class="post-title-link" itemprop="url">ConcurrentHashMap源码学习（java 7）</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-06-29 12:26:25" itemprop="dateCreated datePublished" datetime="2019-06-29T12:26:25+08:00">2019-06-29</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/java/" itemprop="url" rel="index"><span itemprop="name">java</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>ConcurrentHashMap 的实现比较复杂，里面涉及到的内容很多，而且有很多的性能优化的策略，想全部搞清楚比较困难，所以主要对里面感兴趣的并发的处理方面，相关的几个函数的实现看下，难免有理解不到位的地方，以后随时修改补充吧。</p>
<p>这里看的是 java 7 中的实现。</p>
<p>另外，推荐一篇文章，写的很详细： <a target="_blank" rel="noopener" href="https://www.burnison.ca/articles/the-concurrency-of-concurrenthashmap">The Concurrency Of ConcurrentHashMap</a></p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/31d2f121.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/6d9ffe57.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/6d9ffe57.html" class="post-title-link" itemprop="url">令人费解的ThreadLocal</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-06-04 15:05:03" itemprop="dateCreated datePublished" datetime="2019-06-04T15:05:03+08:00">2019-06-04</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/java/" itemprop="url" rel="index"><span itemprop="name">java</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>相关代码来自java 8</p>
<p>ThreadLocal一直给人一种奇怪的感觉：既是多线程共享的变量，每个线程有拥有独立的变量值</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/6d9ffe57.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/1d720228.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/1d720228.html" class="post-title-link" itemprop="url">令人惊叹的HashMap—数据结构与hash函数</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-05-26 21:16:14" itemprop="dateCreated datePublished" datetime="2019-05-26T21:16:14+08:00">2019-05-26</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/java/" itemprop="url" rel="index"><span itemprop="name">java</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>看了下 java 8 中 HashMap 的源码，结合网上一些文章，大概明白了 HashMap 中几个一直很疑惑的地方。这里就记录一下 HashMap 的学习。</p>
<h2 id="数据结构和一些参数的作用"><a href="#数据结构和一些参数的作用" class="headerlink" title="数据结构和一些参数的作用"></a>数据结构和一些参数的作用</h2><p>HashMap 的数据结构“平平无奇”，就是我们熟悉的“数组+链表”的方式（链地址法），并且在链表长度超过某个值（默认为 8）后，将链表转换为红黑树以提高效率。</p>
<p>HashMap 存储数据的数组是：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">transient</span> Node&lt;K,V&gt;[] table;</span><br></pre></td></tr></table></figure>

<p>也即一个 Node 数组，Node 实现 Entry 接口，每个 Node 存储一个键值对，如下：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">final</span> <span class="type">int</span> hash;</span><br><span class="line"><span class="keyword">final</span> K key;</span><br><span class="line">V value;</span><br><span class="line">Node&lt;K,V&gt; next;</span><br></pre></td></tr></table></figure>

<p>其中，hash 是存储的 node 中的 key 的哈希值，key、value 即键和值，而 next 则显然是构建链表的，指向链表的下一个节点。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/1d720228.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/bfd4b596.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/bfd4b596.html" class="post-title-link" itemprop="url">Servlet filter记录</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-03-19 13:54:17" itemprop="dateCreated datePublished" datetime="2019-03-19T13:54:17+08:00">2019-03-19</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Spring/" itemprop="url" rel="index"><span itemprop="name">Spring</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>在 Spring Boot 中观察了一下有新的请求时，Servlet filter 的执行情况，做下记录。</p>
<h2 id="Spring-Boot-默认-Servlet-filter"><a href="#Spring-Boot-默认-Servlet-filter" class="headerlink" title="Spring Boot 默认 Servlet filter"></a>Spring Boot 默认 Servlet filter</h2><p>Spring Boot 会按照 ApplicationFilterChain 中的数组 filters 里保存的 filter 按顺序执行，对于 OrderedFilter 可以指定 order 值（一个 int 值），值小的先执行，不指定 order 时按照首字母顺序执行。</p>
<p>默认情况下，有 CharacterEncodingFilter、HiddenHttpMethodFilter、FormContentFilter 和 RequestContextFilter，以及 webSocket 的 WsFilter。CharacterEncodingFilter、HiddenHttpMethodFilter、FormContentFilter 和 RequestContextFilter 都是使用了 Ordered***Filter 实例，order 值分别是 -2147483648、-10000、-9900 和 -105。</p>
<p>RequestContextFilter 主要用于使用第三方 Servlet 时的情况。关于 CharacterEncodingFilter、HiddenHttpMethodFilter 和 FormContentFilter，其作用可见如下。 </p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/bfd4b596.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/9a904cd8.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/9a904cd8.html" class="post-title-link" itemprop="url">java动态代理：java-Proxy和CGLIB</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-03-07 10:03:18" itemprop="dateCreated datePublished" datetime="2019-03-07T10:03:18+08:00">2019-03-07</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/java/" itemprop="url" rel="index"><span itemprop="name">java</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>一直想了解一下 Spring AOP 的实现，所以看了下 java 动态代理(jdk 8)。</p>
<h2 id="java-Proxy-实现动态代理"><a href="#java-Proxy-实现动态代理" class="headerlink" title="java Proxy 实现动态代理"></a>java Proxy 实现动态代理</h2><p>Proxy 原理是在运行期创建指定的被代理接口的一个实现类，这个类是 Proxy 的子类，并使用反射机制，对接口中声明的方法，用 InvocationHandler 转发函数调用。</p>
<p>Proxy 只能代理接口的实现，会被转发到从其原理不难看出，这是因为生成的代理类已经继承了 Proxy，因为 java 单继承的机制，所以只能实现接口作为其代理。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/9a904cd8.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/d8ab2921.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/d8ab2921.html" class="post-title-link" itemprop="url">java项目使用thin-jar分离依赖优化部署</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-03-03 08:39:56" itemprop="dateCreated datePublished" datetime="2019-03-03T08:39:56+08:00">2019-03-03</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/java/" itemprop="url" rel="index"><span itemprop="name">java</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>项目打包时，直接用spring-boot maven plugin之类插件组装出一个包含了所有依赖的jar，即fat-jar的形式，可以直接启动，部署方便。但是并不是任何时候fat-jar都是最优解。</p>
<h2 id="依赖文件分离打包在几种场景下的优化"><a href="#依赖文件分离打包在几种场景下的优化" class="headerlink" title="依赖文件分离打包在几种场景下的优化"></a>依赖文件分离打包在几种场景下的优化</h2><h3 id="稳定版本依赖包的分离对部署的优化"><a href="#稳定版本依赖包的分离对部署的优化" class="headerlink" title="稳定版本依赖包的分离对部署的优化"></a>稳定版本依赖包的分离对部署的优化</h3><p>在项目开发中，依赖包我们期望是稳定的：版本的升级一定是审慎进行的，新依赖的加入也需要考量。也因此，在项目部署时，如果只打包源代码到一个thin-jar、将固定不变依赖包分离，打包得到的部署文件体积将大大减小——使用spring boot开发的项目打包成fat-jar百兆起步，但其实源代码打包的thin-jar体积很可能是KB级的。</p>
<p>尤其是在使用docker镜像部署jar时，对于镜像打包有优化：虽然对镜像体积减小不会有优化，但是可以将依赖文件置入单独的镜像层复用，镜像构建时多数情况下（依赖未变更的情况下）只需要重新构建源代码及它之上的层，构建速度将会得到提升。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/d8ab2921.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/8062c06c.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/8062c06c.html" class="post-title-link" itemprop="url">Dockerfile-CMD与ENTRYPOINT简记</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-02-25 16:52:22" itemprop="dateCreated datePublished" datetime="2019-02-25T16:52:22+08:00">2019-02-25</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Docker/" itemprop="url" rel="index"><span itemprop="name">Docker</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>CMD，有多个的话之后最后一个生效，作为启动时的默认命令行和用于向 ENTRYPOINT 传递参数，会被 docker run 带的命令行和参数覆盖。</p>
<p>ENTRYPOINT，有多个时最后一个生效，启动时执行，不会被 docker run 带的命令行和参数覆盖。</p>
<h2 id="exec-form-和-shell-form"><a href="#exec-form-和-shell-form" class="headerlink" title="exec form 和 shell form"></a>exec form 和 shell form</h2><p>两者都有 exec 和 shell 两种格式的写法，如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash"><span class="built_in">exec</span> form</span></span><br><span class="line">ENTRYPOINT [&quot;executable&quot;, &quot;param1&quot;, &quot;param2&quot;]</span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">shell form</span></span><br><span class="line">ENTRYPOINT command param1 param2</span><br></pre></td></tr></table></figure>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/8062c06c.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/52cd4209.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/52cd4209.html" class="post-title-link" itemprop="url">bash-shell-ABC</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-02-24 17:04:31" itemprop="dateCreated datePublished" datetime="2019-02-24T17:04:31+08:00">2019-02-24</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Shell/" itemprop="url" rel="index"><span itemprop="name">Shell</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>要在服务器进行一些重复性的体力活，干脆简单看了下shell，下面记录一些内容，都是最基本的用法。</p>
<h3 id="、’’和””（反引号、单引号和双引号）"><a href="#、’’和””（反引号、单引号和双引号）" class="headerlink" title="``、’’和””（反引号、单引号和双引号）"></a>``、’’和””（反引号、单引号和双引号）</h3><p>以输出为例，``内的内容作为一个命令，先执行其中命令，再执行原命令，即代表命令替换；’’内的原原本本的输出；””内的内容，进行参数替换(如$name)和命令替换(如`echo abc`)。</p>
<p>比如下面代码</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">echo &quot;`echo hello world`&quot;</span><br><span class="line">echo &#x27;`echo hello world`&#x27;</span><br></pre></td></tr></table></figure>

<p>输出将是</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hello world</span><br><span class="line">`echo hello world`</span><br></pre></td></tr></table></figure>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/52cd4209.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/edeb6a43.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/edeb6a43.html" class="post-title-link" itemprop="url">正则表达式语法笔记及常用表达式</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-02-11 13:08:35" itemprop="dateCreated datePublished" datetime="2019-02-11T13:08:35+08:00">2019-02-11</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">正则表达式</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>对于正则表达式一向了解不多，假期期间随着《正则表达式必知必会》快速学习了一下正则表达式的基本使用，在此记录一下。</p>
<h1 id="正则表达式语法笔记"><a href="#正则表达式语法笔记" class="headerlink" title="正则表达式语法笔记"></a>正则表达式语法笔记</h1><h2 id="常用元字符"><a href="#常用元字符" class="headerlink" title="常用元字符"></a>常用元字符</h2><table>
<thead>
<tr>
<th align="left">元字符</th>
<th align="left">作用</th>
</tr>
</thead>
<tbody><tr>
<td align="left">.</td>
<td align="left">换行符外任意字符</td>
</tr>
<tr>
<td align="left">\d</td>
<td align="left">一个数字，等价于 [0-9]</td>
</tr>
<tr>
<td align="left">\D</td>
<td align="left">一个非数字，等价于 [^0-9]</td>
</tr>
<tr>
<td align="left">\w</td>
<td align="left">一个数字、字符及下划线，等价于[a-zA-Z0-9_]（最后一个是下划线_）</td>
</tr>
<tr>
<td align="left">\W</td>
<td align="left">一个非数字、字符和下划线，等价于[^a-zA-Z0-9_]（最后一个是下划线_），注意，[]内的 ^，对之后每个组合都取非，不只是紧接的</td>
</tr>
<tr>
<td align="left">\s</td>
<td align="left">一个空白字符，等价于[\f\n\r\t\v ]（最后有个空格），换页、换行、回车、制表、垂直制表符、空格</td>
</tr>
<tr>
<td align="left">\S</td>
<td align="left">一个非空白字符，等价于[^\f\n\r\t\v ]（最后有个空格）</td>
</tr>
</tbody></table>
<p>要注意，[]内出现的的元字符对应字符，不按照元字符处理，不需要要转义，如“.”、“$”等</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/edeb6a43.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/31e339ac.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/31e339ac.html" class="post-title-link" itemprop="url">Spring Boot读取 Resource 资源文件</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-01-24 16:13:02" itemprop="dateCreated datePublished" datetime="2019-01-24T16:13:02+08:00">2019-01-24</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Spring/" itemprop="url" rel="index"><span itemprop="name">Spring</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>整理下 Spring 项目中读取 resources 下的文件的方式，包括 Resource 接口，另外跟一下 ResourceUtils 读取资源文件的流程。</p>
<h2 id="File-方式读取"><a href="#File-方式读取" class="headerlink" title="File 方式读取"></a>File 方式读取</h2><p>直接使用 File 类的接口读取资源文件，需要注意的是传入应是相对路径，生成的项目文件中资源文件的路径可以参考 target 目录下的结构。比如，资源文件目录下的文件 resources&#x2F;static&#x2F;test.html，在生成的 target 目录下路径是：target&#x2F;classes&#x2F;static&#x2F;test.html</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/31e339ac.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/c8a6c539.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/c8a6c539.html" class="post-title-link" itemprop="url">zabbix的部署</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-01-17 14:45:54" itemprop="dateCreated datePublished" datetime="2019-01-17T14:45:54+08:00">2019-01-17</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E7%9B%91%E6%8E%A7/" itemprop="url" rel="index"><span itemprop="name">监控</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>zabbix提供了监控与告警的全套解决方案，在许多大型企业进行了深度实践，功能强大、产品成熟而稳定</p>
<p>选用5.0.4版本，主要的组件有：</p>
<ul>
<li>zabbix-server，拉取&#x2F;接收zabbix-agent的数据，计算触发器条件、向用户发送通知等核心功能</li>
<li>zabbix-agent，客户端，收集本地监控项数据，并通过主动&#x2F;被动方式发送到zabbix-server</li>
<li>zabbix-proxy，可选，负责从一个或多个受监控设备采集监控数据并将信息发送到zabbix-server，以分担zabbix-server的压力</li>
</ul>
<p>此外，根据选用的部署组件版本，zabbix-server如果不包含web功能，还需要部署zabbix-web。zabbix使用Mysql关系型数据库作为底层存储（可选mysql、postgresql、sqlite等），在数据量大的时候对数据库的压力较大，限制了大规模集群中 zabbix 的应用，对告警信息汇总运算时性能较差；并且，zabbix为监控主机、网络设备等基础设置而设计，对于容器监控等场景，zabbix只能通过集成定制化脚本的方式实现且功能有限，在云原生环境下的应用受到限制</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/c8a6c539.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://matian.connorma.cn/919d4f23.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="马天">
      <meta itemprop="description" content="程序猿">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="马天">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/919d4f23.html" class="post-title-link" itemprop="url">Spring security 登陆认证的重要概念、流程梳理及自定义设置</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2018-07-28 20:02:55" itemprop="dateCreated datePublished" datetime="2018-07-28T20:02:55+08:00">2018-07-28</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Spring/" itemprop="url" rel="index"><span itemprop="name">Spring</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>昨天看了下 Spring Security 的使用，打着断点弄清了认证的流程。</p>
<p>首先，可以了解下涉及到的关键的几个类，形成一个整体的了解。</p>
<h2 id="主要的类"><a href="#主要的类" class="headerlink" title="主要的类"></a>主要的类</h2><ol>
<li>Authentication</li>
</ol>
<p>Authentication接口，子类有 AbstractAuthenticationToken，直接用的实现常是 UsernamePasswordAuthenticationToken 类，用于保存认证信息，最重要的字段有：</p>
<ul>
<li>principal</li>
</ul>
<p>对应用户名之类的用户ID。</p>
<ul>
<li>credentials</li>
</ul>
<p>根据用户信息加密生成的凭证，用于认证。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/919d4f23.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  


  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/">1</a><span class="page-number current">2</span><a class="page-number" href="/page/3/">3</a><a class="extend next" rel="next" href="/page/3/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
  </nav>



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">马天</p>
  <div class="site-description" itemprop="description">程序猿</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">41</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">17</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">25</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/matian2014" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;matian2014" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:matian1103@qq.com" title="E-Mail → mailto:matian1103@qq.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        
  <div class="beian"><a href="https://beian.miit.gov.cn/" rel="noopener" target="_blank">陕ICP备2023001563号 </a>
  </div>

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2025</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">马天</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
